<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* .clearfix::after {} */

        .box {
            /* overflow: hidden; */
            width: 800px;
            border: 1px solid saddlebrown;
            margin: 0 auto;
        }

        .box .nav1 {
            width: 300px;
            height: 200px;
            background-color: blueviolet;
            float: left;
        }

        .box .nav2 {
            width: 200px;
            height: 200px;
            background-color: blueviolet;
            float: left;
        }

        .footer {
            height: 200px;
            background-color: black;
        }

        /* .clear {
            clear: both;
        } */
    </style>
</head>

<body>
    <div class="box clearfix">
        <div class="nav1">1</div>
        <div class="nav2">2</div>
        <!-- <div class="clear"></div> -->
    </div>
    <div class="footer"></div>
</body>

</html>